package com.bw.module_mine.ui.mine

import com.bw.module_mine.http.MineApi
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOn
import javax.inject.Inject

/**
 * @author ytx
 * @date 2025-09-20 09:06
 * @description
 */
class MineRepository @Inject constructor() {

    @Inject
    lateinit var api:MineApi

    /**
     * 获得用户信息
     */
    fun getUserInfo() = flow {
        emit(api.getUserInfo())
    }.flowOn(Dispatchers.IO)
    /**
     * 是否签到
     */
    fun isSign() = flow {
        emit(api.isSign())
    }.flowOn(Dispatchers.IO)

    /**
     * 签到
     */
    fun signIn() = flow {
        emit(api.signIn())
    }.flowOn(Dispatchers.IO)


}